﻿Public Class F7_Thue_Thu_Nhap

    Private Sub btnthoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthoat.Click
        Me.Close()
    End Sub

    Private Sub F7_Thue_Thu_Nhap_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        tbxnam.Text = Now.Year
    End Sub

    Private Sub btnthue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthue.Click
        Dim cn As Integer
        Dim pt As Integer
        Dim tn As Integer
        Dim thue As Double

        If (tbxnam.Text = "" Or tbxcanhan.Text = "" Or tbxsophuthuoc.Text = "") Then
            MessageBox.Show("Nhap day du nam va so tien duoc giam tru!", "chu y!")
        Else
            Dim nd As Integer = Me.Tag
            Dim y As Integer = Integer.Parse(tbxnam.Text)
            Label4.Text = XL_PhieuThu.ThuNam(nd, y)

            tn = Integer.Parse(Label4.Text)
            cn = Integer.Parse(tbxcanhan.Text)
            pt = Integer.Parse(tbxsophuthuoc.Text)
            thue = (tn - cn - pt) * 0.1
            If thue > 0 Then
                Labelthue.Text = thue.ToString
            Else
                Labelthue.Text = 0
            End If
        End If
        
    End Sub
End Class